package com.cloudlead.customerAction.action;

import com.cloudlead.common.lang.BusinessModule;
import com.cloudlead.common.lang.annotation.Label;
import com.cloudlead.common.lang.persistence.Page;
import com.cloudlead.common.worker.action.impl.AbstractActionFactory;
import com.cloudlead.common.worker.annotation.Action;
import com.cloudlead.common.worker.annotation.Order;
import com.cloudlead.customerAction.BusinessModules;
import com.cloudlead.customerAction.service.BookingSpaceOrderFindSer;
import com.cloudlead.customerService.BookingSpaceOrderFindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.validation.constraints.NotNull;

/**
 * Created by wyj on 2015/8/31.
 */
@Controller
public class BookingSpaceOrderFindActionFactory extends AbstractActionFactory implements BookingSpaceOrderFindService {
    public BookingSpaceOrderFindActionFactory() {
        super(BusinessModules.BookingSpaceOrderFind);
    }

    @Autowired
    BookingSpaceOrderFindSer bookingSpaceOrderFindSer;

    @Override
    @Action
    @Order(1)
    @Label("订舱单单值查询")
    public Object bookingSpaceOrderFind(@Label("订单ID")String customerOrderId,@Label("订舱单ID")String id) {
        return bookingSpaceOrderFindSer.bookingSpaceOrderFind(customerOrderId,id);
    }

    @Override
    @Action
    @Order(2)
    @Label("订舱单分页查询")
    public Page<Object> bookingSpaceOrderFindAll(@Label("公司ID")String companyId,@Label("每页数量")int size, @Label("页码")int page) {
        return bookingSpaceOrderFindSer.bookingSpaceOrderFindAll(companyId,size,page);
    }

    @Override
    @Action
    @Order(3)
    @Label("订舱单状态的修改")
    public String bookingSpaceOrderCreate(@NotNull @Label("订舱单ID")String id,
                                        @Label("订舱单状态(“接受”或者“拒绝”)")String orderStatus ) {

        return bookingSpaceOrderFindSer.bookingSpaceOrderCreate(id,orderStatus);
    }
}
